﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RMCharGen.Character;

namespace RMCharGen
{
    public partial class Main : Form
    {

        internal CharacterSheet CurrentCharacter
        {
            get;
            set;
        }

        internal void CharacterUpdated()
        {
            CurrentStatistics.Bind();
        }

        public Main()
        {
            InitializeComponent();
        }

        private void Main_Load(object sender, EventArgs e)
        {
            CurrentCharacter = new CharacterSheet();
            CurrentStatistics.Character = CurrentCharacter;
            CurrentStatistics.Bind();
        }

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Statistics.CharacterUpdated callback = new Statistics.CharacterUpdated(this.CharacterUpdated);
            Statistics s = new Statistics(this.CurrentCharacter,
                                          callback);
            s.ShowDialog();
        }

    }
}
